<template>
  <div>
    <div class="article-item" v-for="element in listData" :key="element.id">
      <p>标题：{{ element.title }}</p>
      <p>作者：{{ element.author }}</p>
      <p>时间：{{ element.create_time }}</p>
      <p>内容：{{ element.content }}</p>
    </div>
  </div>
</template>

<script>
  export default {
    props: {
      dataList: Array
    },
    data() {
      return {
        listData: [{
          title: "t1",
          author: "a1",
          create_time: "2025-06-18 01:30:37",
          content: "c1"
        },{
          title: "t2",
          author: "a2",
          create_time: "2025-06-19 01:30:38",
          content: "c2"
        },{
          title: "t3",
          author: "a3",
          create_time: "2025-06-20 01:30:39",
          content: "c3"
        }]
      }
    },
    mounted() {
      console.log("mounted");
      console.log(this.dataList);
      if (this.dataList) {
        this.listData = this.dataList;
      }
    }
  }
</script>


<style lang="scss" scoped>
.article-item {
  /*background-color: blue;*/
  border: 1px solid blue;
  margin: 5px 0;
}
</style>
